#include <iostream>
#include<windows.h>
#include<stdlib.h>
using namespace std;

const int N=1000;
double b[N][N],a[N],sum[N];

void init()
{
    for(int i=0;i<N;i++)
    {   a[i]=i;
        for(int j=0;j<N;j++)
        {
            b[i][j]=i+j;
        }
    }

}
// matrix
int main()
{
    long long head, tail , freq ; // timers
    init ();
    // similar to CLOCKS_PER_SEC
    QueryPerformanceFrequency((LARGE_INTEGER *)&freq );
    // start time
    QueryPerformanceCounter((LARGE_INTEGER *)&head);

for(int n=0;n<10;n++)
{

    for(int i=0;i<N;i++)
    {
        sum[i]=0.0;
        for(int j=0;j<N;j++)
        {
            sum[i]+=b[j][i]*a[j];
        }
    }

}
    // end time
    QueryPerformanceCounter((LARGE_INTEGER *)&tail );
    cout<<"Time:" << ((tail- head) * 1.0 )/ freq << "s" << endl;


    system("pause");
    return 0;
}
